/*
 * @Author: zhuxiaoyi
 * @Date: 2024-01-26 11:27:49
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2024-04-23 17:11:18
 * @Description:
 */
import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn,
  UpdateDateColumn,
  ManyToOne,
  JoinColumn,
  OneToOne,
} from 'typeorm';
import { Algorithm } from './algorithm.entity';

@Entity('tb_task_detial')
export class Task {
  @PrimaryGeneratedColumn()
  id: number;

  @Column({
    length: 100,
  })
  name: string;

  @Column()
  status: number;

  @Column({nullable: true})
  type:number

  @Column({ nullable: true })
  progress: number;

  @CreateDateColumn()
  createDate: Date;

  @UpdateDateColumn()
  updateDate: Date;

  // 设置与算法表的关联关系
  @ManyToOne(type => Algorithm, algorithm => algorithm.tasks)
  @JoinColumn()
  algorithm: Algorithm;
}
